package 二叉树;

//404 左叶子之和
public class Solution9 {
    public int sumOfLeftLeaves(TreeNode root) {
        if(root==null)return 0;
        int val = 0;
        if(root.left!=null&&root.left.left==null&&root.left.right==null){
            val=root.left.val;
        }
        return sumOfLeftLeaves(root.left)+sumOfLeftLeaves(root.right)+val;
    }
}
